package com.we823.cms.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.alibaba.fastjson.annotation.JSONField;
import com.we823.cms.common.WebConstants;

@MappedSuperclass
public abstract class BaseModelWithDate<ID extends Serializable> extends BaseModel<ID> {

	private static final long serialVersionUID = 1L;
	
	@DateTimeFormat(pattern=WebConstants.DATE_FORMAT)
	@Temporal(TemporalType.TIMESTAMP)
	private Date addtime;
	
	@DateTimeFormat(pattern=WebConstants.DATE_FORMAT)
	@Temporal(TemporalType.TIMESTAMP)
	private Date edittime;
	
	@JSONField(format=WebConstants.DATE_FORMAT)
	public Date getAddtime() {
		return addtime;
	}
	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}
	
	@JSONField(format=WebConstants.DATE_FORMAT)
	public Date getEdittime() {
		return edittime;
	}
	public void setEdittime(Date edittime) {
		this.edittime = edittime;
	}
	
	
}
